//
//  BlackjackGame.h
//  Blackjack
//
//  Created by mrbradle on 11/7/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface BlackjackGame : NSObject {
    
    NSString* name;
    
    int minBet;
    int maxBet;
    int currentMaxBet; //The maximum bet might change depending on how many chips our player has
    
    int status;
    //0 if not started
    //1 if waiting for bet
    //2 if player's turn
    //3 if house's turn
    //4 if round is ended and waiting for new round
    
    int rounds;
    int chips;
    
    int currentChips;
    int currentRound;
    int currentBet;
    
    int* playerCards;
    int* houseCards;
    int currentPlayerCards;
    int currentHouseCards;
    
    bool playerHasAce; //If this is true, the player's hand might actually be 10 less than the current value
    bool houseHasAce;
    int playerValue; //The highest possible value of the player's hand.
    int houseValue;
    
    int* deck;
    int currentDeckPosition;
    
}

- (id)initWithChips:(int)chips rounds:(int)rounds;

- (void)shuffle;

- (void)newGame;
- (void)newRound;
- (void)deal;
- (void)hit;
- (void)stand;
- (void)double_;
- (void)split;
- (void)bust;
- (void)reveal;
- (void)playHouse;

- (void)win;
- (void)lose;
- (void)endRound;
- (void)endGame;


@property (nonatomic,retain) IBOutlet NSString* name;

@property (nonatomic) IBOutlet NSInteger rounds;
@property (nonatomic) IBOutlet NSInteger chips;
@property (nonatomic) IBOutlet NSInteger currentChips;
@property (nonatomic) IBOutlet NSInteger currentRound;
@property (nonatomic) IBOutlet NSInteger currentBet;

@property (nonatomic) IBOutlet NSInteger status;
@property (nonatomic) IBOutlet NSInteger minBet;
@property (nonatomic) IBOutlet NSInteger maxBet;
@property (nonatomic) IBOutlet NSInteger currentMaxBet;

@property (nonatomic) IBOutlet NSInteger* playerCards;
@property (nonatomic) IBOutlet NSInteger* houseCards;
@property (nonatomic) IBOutlet NSInteger currentPlayerCards;
@property (nonatomic) IBOutlet NSInteger currentHouseCards;
@property (nonatomic) IBOutlet NSInteger* deck;
@property (nonatomic) IBOutlet NSInteger currentDeckPosition;

@property (nonatomic) IBOutlet bool playerHasAce;
@property (nonatomic) IBOutlet bool houseHasAce;
@property (nonatomic) IBOutlet NSInteger playerValue;
@property (nonatomic) IBOutlet NSInteger houseValue;

@end
